import request from "@/utils/request";

export async function findEmpByNameOrCode(params) {
  return request('/api/member/api-member/job/findEmpByNameOrCode', {
    method: 'get',
    params: params,
  }).then((res) => {
    if (res.flag){
      return res.data;
    }
    return [];
  });
}

export async function getDepartmentUser(orgId,isDismiss) {
  return request(`/api/member/api-member/roleAssignment/getDepartmentUser`, {
    params: {
      orgId:orgId,
      isDismiss:isDismiss ? true : false
    },
    method: 'get',
  }).then((res) => {
    return res.data;
  });
}

export async function findEmpByUserCodes(userCodeList) {
  return request(`/api/member/api-member/promotion/findEmpByUserCodes`, {
    method: 'post',
    data: {str:userCodeList},
    requestType: 'form',
  }).then((res) => {
    return res.data;
  });
}

export async function getUserOrgById(userId) {
  return request(`/api/member/api-member/roleAssignment/getUserOrgById?userId=${userId}`, {
    method: 'get',
  }).then((res) => {
    return res.data;
  });
}
